package com.design.pattern.entry.fruit;

import com.design.pattern.action.visit.Visit;
import com.design.pattern.entry.Fruit;
import com.design.pattern.entry.bag.AppleBag;

/**
 * 苹果
 *
 * @author gyf
 * @create 2018-11-30 13:53
 **/
public class Apple implements Fruit {
    private int price = 100;

    public Apple() {

    }

    public Apple(int price) {
        this.price = price;
    }

    public void pack(AppleBag appleBag) {
        appleBag.pack();
    }

    @Override
    public int price() {
        return price;
    }

    @Override
    public void draw() {
        System.out.println("苹果红富士");
    }

    @Override
    public int accept(Visit visit) {
        return visit.sell(this);
    }

    public void setPrice(int price) {
        this.price = price;
    }
}
